//
//  SQWorkView.m
//  cloudManagerBoss
//
//  Created by 苏青 on 2020/3/25.
//  Copyright © 2020 Qing 苏. All rights reserved.
//

#import "SQWorkView.h"


@implementation SQWorkView{
    NSDictionary * dic;
}


+ (instancetype)shareWithData:(NSDictionary *)data frameX:(float *)x frameY:(float *)y{
    SQWorkView *view = [NSBundle.mainBundle loadNibNamed:SQWorkView.className owner:nil options:nil].firstObject;
   
    float xx = (YYScreenWidth() - 20) / 4;
    if (*x + xx > YYScreenWidth() - 20) {
        *x = 0;
        *y += 100;
    }
    view.frame = CGRectMake(*x, *y, xx, 100);
    view -> dic = data;
    view -> _imgV_pic.image = [UIImage imageNamed:data[@"pic"]];
    view -> _lab_title.text = data[@"name"];
      
  
    *x += xx;
    
    return view;
}


- (IBAction)clickCertain:(UIButton *)sender {
    self.callBack(dic);
}


@end
